package com.procurement.inquiry.service.impl;


import com.procurement.inquiry.domain.PcmQuotationProduct;
import com.procurement.inquiry.domain.PcmSupplier;
import com.procurement.inquiry.mapper.PcmAuditMapper;
import com.procurement.inquiry.service.IPcmAuditService;
import com.ruoyi.system.api.domain.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 我的待办模块
 */
@Service
public class PcmAuditServiceImpl implements IPcmAuditService {

    @Autowired
    private PcmAuditMapper pcmAuditMapper;

    @Override
    public List<PcmAudit> selectPcmAuditList(Long supplierId) {
        return pcmAuditMapper.selectPcmAuditList(supplierId);
    }

    @Override
    public PcmInquiryDemand selectPcmInquryDemandId(String inquiryDemandNumber) {
        return pcmAuditMapper.selectPcmInquryDemandId(inquiryDemandNumber);
    }

    @Override
    public PcmSupplier selectPcmSupplier(Long supplierID2) {
        return pcmAuditMapper.selectPcmSupplier(supplierID2);
    }

    @Override
    public com.procurement.inquiry.domain.PcmInquiryDemand selectPcmInquiryDemandList(String inquiryDemandNumber) {
        return pcmAuditMapper.selectPcmInquiryDemandList(inquiryDemandNumber);
    }

    @Override
    public PcmSupplierQuotation selectSupplierQuotation(Long quotationID) {
        return pcmAuditMapper.selectSupplierQuotation(quotationID);
    }

    @Override
    public PcmSupplierQuotation selectSupplierQuotation2(String inquiryDemandNumber,Long quotingSupplier,String auditTableNumber) {
        return pcmAuditMapper.selectSupplierQuotation2(inquiryDemandNumber,quotingSupplier,auditTableNumber);
    }

    @Override
    public int insertPcmQuotationProduct(PcmQuotationProduct pcmQuotationProduct) {
        return pcmAuditMapper.insertPcmQuotationProduct(pcmQuotationProduct);
    }

    @Override
    public List<com.ruoyi.system.api.domain.PcmQuotationProduct> selectPcmQuotationProduct(Long id) {
        return pcmAuditMapper.selectPcmQuotationProduct(id);
    }

    @Override
    public PcmMaterialRecord selectPcmMaterialRecord(String productNumber) {
        return pcmAuditMapper.selectPcmMaterialRecord(productNumber);
    }

    @Override
    public int updatePcmQuotationProduct(PcmQuotationProduct pcmQuotationProduct) {
        return pcmAuditMapper.updatePcmQuotationProduct(pcmQuotationProduct);
    }

    @Override
    public int updatePcmSupplierQuotation(PcmSupplierQuotation pcmSupplierQuotation) {
        return pcmAuditMapper.updatePcmSupplierQuotation(pcmSupplierQuotation);
    }

    @Override
    public PcmSupplier selectPcmSupplier2(Long permission) {
        return pcmAuditMapper.selectPcmSupplier2(permission);
    }

    @Override
    public int updatePcmAudit(Long circulationStatus, Long auditId) {
        return pcmAuditMapper.updatePcmAudit(circulationStatus,auditId);
    }

    @Override
    public int insertAttach(String attachmentName, String attachmentAddress, Long quotationID) {
        return pcmAuditMapper.insertAttach(attachmentName,attachmentAddress,quotationID);
    }

    @Override
    public int deleteAttach(Long quotationID) {
        return pcmAuditMapper.deleteAttach(quotationID);
    }

    @Override
    public List<SysFile> selectAttach(Long quotationID) {
        return pcmAuditMapper.selectAttach(quotationID);
    }

    /**
     * 查询供应商供应样品管理
     *
     * @param supplierSampleManagementID 供应商供应样品管理主键
     * @return 供应商供应样品管理
     */
    @Override
    public PcmSupplierSampleManagement selectPcmSupplierSampleManagementBySupplierSampleManagementID(Long supplierSampleManagementID) {
        return pcmAuditMapper.selectPcmSupplierSampleManagementBySupplierSampleManagementID(supplierSampleManagementID);
    }

    @Override
    public SrmApprovals selectSrmClaAll(Long srmID) {
        return pcmAuditMapper.selectSrmClaAll(srmID);
    }

    /**
     * 查询采购申请
     *
     * @param purchaseRequestNumber 采购申请主键
     * @return 采购申请
     */
    public PcmPurchaseRequest selectPcmPurchaseRequestByPurchaseRequestNumber(String purchaseRequestNumber){
        return pcmAuditMapper.selectPcmPurchaseRequestByPurchaseRequestNumber(purchaseRequestNumber);
    };

    public boolean updatePcmPurchaseRequest(PcmAudit pcmAudit){
        return pcmAuditMapper.updatePcmPurchaseRequest(pcmAudit);
    };

    public boolean updateRequest(PcmPurchaseRequest pcmPurchaseRequest){
        return  pcmAuditMapper.updateRequest(pcmPurchaseRequest);
    };

    public boolean updateApplicationDetail(String Number){
        return pcmAuditMapper.updateApplicationDetail(Number);
    }

    @Override
    public PcmBiddingInviteTenders selInvitationInformation(Long middleId) {
        return pcmAuditMapper.selInvitationInformation(middleId);
    }

    @Override
    public PcmInvitedSupplier selByInvitedSupplierId(Long invitedSupplierId) {
        return pcmAuditMapper.selByInvitedSupplierId(invitedSupplierId);
    }

    @Override
    public Map<String, Object> selEvaluationContent(Long expertSupplierId) {
        return pcmAuditMapper.selEvaluationContent(expertSupplierId);
    }

    @Override
    public int updateAudit(Long AuditId, Long supplierId) {
        return pcmAuditMapper.updateAudit(AuditId,supplierId);
    }
}
